﻿/*
 Copyright (c) 2006 Eric J. Feminella  <eric@ericfeminella.com>
 All rights reserved.

 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 in the Software without restriction, including without limitation the rights
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the Software is furnished
 to do so, subject to the following conditions:

 The above copyright notice and this permission notice shall be included in all
 copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
 PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

 @internal
 */

package com.ericfeminella.diagnostics{
	/**
	     *
	     * Defines the contract for classes which are to provide an
	     * API which calculates the time of a code execution
	     *
	     */
	public interface IExecutable {
		/**
		         *
		         * Retrieves the total execution measurement based on the
		         * current <code>executionStartTime</code> and the current
		         * <code>executionStopTime</code>
		         *
		         * @return integer representing the total execution duration
		         *
		         */
		function getElapsedTime():int;

		/**
		         *
		         * Determines the total time (in milliseconds) which
		         * has elapsed for a specific <code>Execution</code>
		         *
		         * @return the total execution time in milliseconds
		         *
		         */
		function getExecutionTotalDuration():int;

		/**
		         *
		         * Starts the current execution measurements and sets the
		         * value of the <code>executionStartTime</code> property
		         * to the value of the current getTimer(); Flash Player
		         * call
		         *
		         * @return an integer representing the start time
		         *
		         */
		function start():int;

		/**
		         *
		         * Stops the current execution measurements and sets the
		         * value of the <code>executionStopTime</code> property
		         * to the value of the current getTimer(); Flash Player
		         * call
		         *
		         * @return an integer representing the stop time
		         *
		         */
		function stop():int;

		/**
		         *
		         * Retrieves the initial start time for the current
		         * <code>Execution</code> instance
		         *
		         * @return the start time in milliseconds
		         *
		         */
		function get startTime():int;

		/**
		         *
		         * Retrieves the initial start time for the current
		         * <code>Execution</code> instance
		         *
		         * @return the start time in milliseconds
		         *
		         */
		function get stopTime():int;
	}
}